package io.renren.modules.money.controller;

import io.renren.common.utils.R;
import io.renren.modules.money.model.Money;
import io.renren.modules.money.model.SearchRecord;
import io.renren.modules.money.service.MoneyService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author A夜兔A
 * @data 2021年11月19日 9:33
 */
@RestController
@RequestMapping("/money")
public class MoneyController {

    @Autowired
    private MoneyService moneyService;

    @ApiOperation("消费或充值金额")
    @PostMapping("/changeMoney")
    public R changeMoney(@RequestBody Money money){
        return moneyService.changeMoney(money);
    }

    @ApiOperation("充值或消费记录")
    @PostMapping("/record")
    public R record(@RequestBody SearchRecord searchRecord){
        return moneyService.record(searchRecord);
    }


}
